home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / t_pdf.pro < prev    next >
Text File  |  1997-07-08  |  2KB  |  55 lines

  1. ;$Id: t_pdf.pro,v 1.3 1997/01/15 03:11:50 ali Exp $
  2. ;
  3. ; Copyright (c) 1994-1997, Research Systems, Inc.  All rights reserved.
  4. ;       Unauthorized reproduction prohibited.
  5. ;+
  6. ; NAME:
  7. ;       T_PDF
  8. ;
  9. ; PURPOSE:
  10. ;       This function computes the probabilty (p) such that:
  11. ;                   Probability(X <= v) = p
  12. ;       where X is a random variable from the Student's t distribution
  13. ;       with (df) degrees of freedom.
  14. ;
  15. ; CATEGORY:
  16. ;       Statistics.
  17. ;
  18. ; CALLING SEQUENCE:
  19. ;       Result = T_pdf(V, DF)
  20. ;
  21. ; INPUTS:
  22. ;       V:    A scalar of type integer, float or double that specifies
  23. ;             the cutoff value.
  24. ;
  25. ;      DF:    A positive scalar of type integer, float or double that
  26. ;             specifies the degrees of freedom of the Student's t 
  27. ;             distribution.
  28. ;
  29. ; EXAMPLE:
  30. ;       Compute the probability that a random variable X, from the 
  31. ;       Student's t distribution with (df = 15) degrees of freedom,
  32. ;       is less than or equal to 0.691. The result should be 0.749940
  33. ;         result = t_pdf(0.691, 15)
  34. ;
  35. ; REFERENCE:
  36. ;       APPLIED STATISTICS (third edition)
  37. ;       J. Neter, W. Wasserman, G.A. Whitmore
  38. ;       ISBN 0-205-10328-6
  39. ;
  40. ; MODIFICATION HISTORY:
  41. ;       Modified by:  GGS, RSI, July 1994
  42. ;                     Minor changes to code. New documentation header.
  43. ;-
  44.  
  45. function t_pdf , v, df
  46.  
  47.   on_error, 2  ;Return to caller if error occurs.
  48.  
  49.   if df le 0 then message, $
  50.     'Degrees of freedom must be positive.'
  51.  
  52.   return, 1.0 - 0.5 * ibeta_pdf(df/(df + v^2), df/2.0, 0.5) 
  53. end 
  54.  
  55.